Scan flip-flop and associated method

ABSTRACT

Scan flip-flop and associated method are provided. The scan flip-flop includes a data input terminal, a scan input terminal, a flip-flop circuit, a first transistor and a plurality of second transistors. A gate of the first transistor is coupled to the scan input terminal, gates of the second transistors are commonly coupled to an enabling signal, drains and sources of the first transistor and the second transistors are serially coupled to the flip-flop circuit, so as to increase a delay between the scan input terminal and the flip-flop circuit.

This application is a divisional of U.S. patent application Ser. No.14/519,484, filed Oct. 21, 2014, which claims the benefit of TaiwanPatent Application No. 102137974, filed Oct. 21, 2013, and the contentsof which are incorporated herein by reference.

FIELD OF THE INVENTION

The present invention relates to a scan flip-flop and associated method,and more particularly, to a scan flip-flop and associated method capableof providing effective solution to hold-time violation.

BACKGROUND OF THE INVENTION

Semiconductor integrated circuit (IC, e.g., chip, die, etc.) is formedby many circuitry cells, and scan flip-flop is one of the mostfrequently adopted standard cells. Scan flip-flop may switch between anormal operation mode and a scan test mode; architecture of scanflip-flop may be equivalent to a multiplexer and an ordinary flip-flopcircuit (e.g., a master-slave flip-flop). The multiplexer may have adata input terminal and a scan input terminal, and may respectivelyconduct the data input terminal and the scan input terminal to theflip-flop circuit during the normal operation mode and the scan testmode; hence, under triggering of a clock, the flip-flop circuit maylatch and sample a signal which is selected to be conducted by themultiplexer; i.e., latch and sample data signal conducted from the datainput terminal during the normal operation mode, and, on the other hand,latch and sample scan input signal conducted from the scan inputterminal during the scan test mode.

To implement normal operation functions of an integrated circuit, thedata input terminal of each scan flip-flop may be coupled to a logicblock responsible for the normal operation functions; on the other hand,the scan input terminal may be coupled to an output terminal of anotherscan flip-flop, such that different scan flip-flops may be seriallycoupled as a scan chain for transmitting information related to a scantest. Please refer to FIG. 1 illustrating an architecture example of atypical digital circuit; this example may include two flip-flops FF[1]and FF[2], both are scan flip-flops; each flip-flop FF[.] may includeterminals D, SI, SE, CK and Q, respectively as a data input terminal, ascan input terminal, a scan enabling terminal, a clock terminal and anoutput terminal. A terminal Q0 may be coupled to the terminal D of theflip-flop FF[1] via a logic block LOGIC[1], and a terminal Q1 from theterminal Q of the flip-flop FF[1] may be coupled to a subsequentflip-flop FF[2] via another logic block LOGIC[2], such that a data pathof the normal operation mode may be established. On the other hand, tosupport the scan test mode, the terminal Q0 may be further coupled tothe terminal SI of the flip-flop FF[1], and the terminal Q1 may befurther coupled to the terminal SI of the flip-flop FF[2], such that adata path of the scan test mode, i.e., the scan chain, may be formed.

FIG. 1 also shows a typical architecture of a scan flip-flop, whichincludes transistors Tp1 to Tp6 (e.g., p-channel MOS transistors),transistors Tn1 to Tn6 (e.g., n-channel MOS transistors), and inverters10 a and 10 b, 12 a and 12 b, 14 a and 14 b, as well as 16 and 18. Theclock received by the terminal CK is inverted by the inverter 10 a andoutputted to a terminal CKB, and a clock at the terminal CKB is invertedby the inverter 18 and outputted to a terminal CKI; the signal at theterminal SE is inverted by the inverter 18 and outputted to a terminalSEB. The transistors Tp1 to Tp4 and Tn1 to Tn4 form a multiplexer 32.The transistors Tp5 to Tp6, Tn5 to Tn6, the inverters 12 a and 12 b, theinverters 12 b and 14 b controlled by the terminals CKI and CKB, as wellas the inverter 16, collectively form a flip-flop circuit 34, which hasa node 0 as an internal terminal, and outputs to the terminal Q. Whenthe flip-flop FF[1] operates under the scan test mode, the terminal SEis raised to high level (logic 1), so the transistors Tn2 and Tp2 areturned on to conduct, and a voltage at the node n0 can therefore becontrolled by the signal at the terminal SI, allowing the flip-flopcircuit 34 to receive the signal from the scan chain; on the other hand,the transistors Tp3 and Tn3 are turned off and stops conducting. Whenthe flip-flop FF[1] works under the normal operation mode, the terminalSE is pulled down to low level (logic 0), hence the transistors Tn3 andTp3 are turned on; accordingly, a voltage at the node n0 can becontrolled by the signal at the terminal D, allowing the flip-flopcircuit 34 to receive the signal of normal operation; on the other hand,the transistors Tp2 and Tn2 are turned off.

In FIG. 1, a clock CKin is utilized to trigger the flip-flop circuits(e.g., the flip-flop circuit 34) of the flip-flops FF[1] and FF[2].However, due to signal delays respectively introduced by the logiccircuits LOGIC[1] and LOGIC[2], actual triggering clocks CK[1] and CK[2]respectively received at the terminals CK of the flip-flops FF[1] andFF[2] have be accordingly tuned, wherein delayers CTSD[1] and CTSD[2]respectively represent clock delays deliberately introduced by clocktree synthesis. However, delays along the scan chain and delays alonethe data path of the normal operation mode are different (the former areusually shorter); the clocks determined according to demands of thenormal operation functions will cause the scan flip-flops to violatetiming specifications of the scan test mode, e.g., to violate hold-timerequirement. Similarly, if the clocks of the scan flip-flops are tunedaccording to timing of the scan test, then the normal operationfunctions will be influenced. To overcome timing violation of scanflip-flops, a known art is inserting additional delayer buffers alongthe scan chain, such as the buffers BUFF[1] and BUFF[2] shown in FIG. 1.However, inserting buffers also expands total area of the integratedcircuit, degrades integrity of the integrated circuit, increases powerconsumption, lengthens routing distance, and decreases flexibility ofscan reordering (reordering the scan chain).

For satisfying both timing of normal operation and timing of scan chain,IC design flow usually needs to repeat many iterations to seek a balancebetween timing of normal operation and timing of scan chain,consequently consumes significant design time, cost and resource toinsert many buffers to integrated circuit, and sometimes even fails toconverge to a result capable of satisfying both timing demands. Foradvanced fabrication of small dimension, because of shorter delay fromthe terminals CK to Q, shorter data setup time, greater variationbetween timing of different chips, and higher uncertainty of clock,influence of hold-time violation becomes severer, and therefore becomesa major challenge of circuit design.

Some prior arts attempt to embed scan chain delay into scan flip-flop,such as U.S. Pat. Nos. 6,389,566, 6,895,540 and 7,649,395. However,these prior arts still suffer disadvantages, such as: number of outputterminals incompatible to standard cell, greater layout overhead, lowerdelay efficiency (delay per unit area) to delay scan chain, and/orfailure to correctly operate under low supply voltage utilized in modernadvance fabrication process.

SUMMARY OF THE INVENTION

An objective of the invention is providing a scan flip-flop (e.g., 30 inFIG. 2), which may include a data input terminal (e.g., D in FIG. 2)coupled to a data signal, a scan input terminal (e.g., SI in FIG. 2)coupled to a scan input signal, and a flip-flop circuit (e.g., 38 inFIG. 2); and may further include: a first transistor (e.g., P1 in FIG.2), a plurality of second transistors (e.g., Mp[1] to Mp[4] in FIG. 2),a third transistor (e.g., P3 in FIG. 2), a fourth transistor (e.g., N1in FIG. 2), a plurality of fifth transistors (e.g., Mn[1] to Mn[4]) anda sixth transistor (e.g., N3 in FIG. 2), so as to jointly form amultiplexer (e.g., 36 in FIG. 2).

The first transistor may include a first gate, a first source and afirst drain; each second transistor may include a second gate, a secondsource and a second drain; the third transistor may include a thirdgate, a third source and a third drain; the fourth transistor mayinclude a fourth gate, a fourth source and a fourth drain; each fifthtransistor may include a fifth gate, a fifth source and a fifth drain;the sixth transistor may include a sixth gate, a sixth source and asixth drain. The flip-flop circuit may include a first internal inputterminal and a second internal input terminal (e.g., at nodes n1 a andn1 b, FIG. 2). Those second sources and second drains, along with thefirst source and first drain, may be serially coupled between a firstvoltage (e.g., Vdd in FIG. 2) and the first internal input terminal; thefirst gate may be coupled to the scan input terminal, and the secondgates may be commonly coupled to a first enabling signal (e.g., atterminal SEB, FIG. 2). The third source and the third drain may becoupled between the first internal input terminal and the data inputterminal, and the third gate may be coupled to a second enabling signal(e.g., at terminal SE, FIG. 2); wherein the second enabling signal andthe first enabling signal are of opposite phases. Those fifth sourcesand fifth drains, along with the fourth source and the fourth drain, maybe serially coupled between a second voltage (e.g., G in FIG. 2) and thesecond internal input terminal; the fourth gate may be coupled to thescan input terminal, and the fifth gates may be commonly coupled to thesecond enabling signal. The sixth source and the sixth drain may becoupled between the second internal input terminal and the data inputterminal, and the sixth gate may be coupled to the first enablingsignal.

An objective of the invention is providing a method (e.g., flowchart 100in FIG. 4) for a circuit layout, which may include: placing a pluralityof first kind scan flip-flops (e.g., FF[k1] to FF[k4] in FIG. 4) in thecircuit layout, and reserving an associated adjacent vacant region(e.g., A[k] in FIG. 4) aside each (e.g., FF[k] in FIG. 4) of theplurality of first kind scan flip-flops; performing a scan treesynthesis (e.g., 106 in FIG. 4) to provide a clock for each of theplurality of first kind scan flip-flops, performing a timing test on theplurality of first kind scan flip-flops by computer, and accordinglyselecting a first number of to-be-replaced flip-flops (e.g., FF[k1] andFF[k3] in FIG. 4) from the plurality of first kind scan flip-flops; and,performing a replacement step (e.g., 110 in FIG. 4) by replacing each ofthe first number of to-be-replaced flip-flops with a second kind scanflip-flop (e.g., eFF[k1] or eFF[k3] in FIG. 4); wherein an area of eachsecond kind scan flip-flop (e.g., eFF[k] in FIG. 4) may be greater thanan area of each first kind scan flip-flop (e.g., FF[k] in FIG. 4); atotal area of each first kind scan flip-flop and the associated vacantregion may cover the area of each second kind scan flip-flop.

Each second kind scan flip-flop may include a data input terminal (e.g.,D in FIG. 2), a scan input terminal (e.g., SI in FIG. 2), a flip-flopcircuit (e.g., 38 in FIG. 2) which may include an internal terminal(e.g., at node n1 a), as well as a first transistor (e.g., P1 in FIG. 2)and a plurality of second transistors (e.g., Mp[1] to Mp[4] in FIG. 2).Drains and sources of the first transistor and the second transistorsmay be serially coupled between a first voltage (e.g., Vdd in FIG. 2)and the first input terminal; a gate of the first transistor may becoupled to the scan input terminal, and gates of the second transistorsmay be commonly coupled together. The method of the invention may alsoinclude a scan reordering.

Numerous objects, features and advantages of the present invention willbe readily apparent upon a reading of the following detailed descriptionof embodiments of the present invention when taken in conjunction withthe accompanying drawings. However, the drawings employed herein are forthe purpose of descriptions and should not be regarded as limiting.

BRIEF DESCRIPTION OF THE DRAWINGS

The above objects and advantages of the present invention will becomemore readily apparent to those ordinarily skilled in the art afterreviewing the following detailed description and accompanying drawings,in which:

FIG. 1 (prior art) illustrates a typical scan flip-flop and itsapplication;

FIG. 2 illustrates a scan flip-flop according to an embodiment of theinvention;

FIG. 3 illustrates a layout according to an embodiment of the invention,which may implement the scan flip-flop shown in FIG. 2; and

FIG. 4 illustrates a flowchart according to an embodiment of theinvention.

DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS

Please refer to FIG. 2 illustrating a flip-flop 30 according to anembodiment of the invention. The flip-flop 30 may be a scan flip-flop,operate between DC supply voltages Vdd and G (e.g., ground), and haveterminals D, SI, SE, CK and Q as a data input terminal, a scan inputterminal, a scan enabling terminal, a clock terminal and an outputterminal. The flip-flop 30 may include: inverters 20 a and 20 b, 22 aand 22 b, 24 a and 24 b, 26 and 28; transistors (e.g., p-channel MOStransistors) P1 and P3 to P6, as well as transistors (e.g., n-channelMOS transistors) N1 and N3 to N6; the flip-flop 30 may also include aplurality of transistors Mp[1], Mp[2], . . . etc., which may beexemplified by the transistors Mp[1] to Mp[4] in FIG. 2; furthermore,the flip-flop 30 may include a plurality of transistors Mn[1], Mn[2], .. . etc., such as the transistors Mn[1] to Mn[4] in FIG. 2. Eachtransistor Mp[.] may be a p-channel MOS transistor, and each transistorMn[.] may be an n-channel MOS transistor. A clock received by theterminal CK may be inverted by the inverter 20 a and outputted to aterminal CKB, the clock at the terminal CKB may be inverted by theinverter 20 b and outputted to a terminal CKI; a signal (e.g., a secondenabling signal) at the terminal SE may be inverted by the inverter 28and outputted to a terminal SEB (e.g., as a first enabling signal with aphase opposite to that of the second enabling signal).

In the flip-flop 30, the transistors P1, Mp[.] (e.g., Mp[1] to Mp[4]),P3, N1, Mn[.] (e.g., Mn[1] to Mn[4]) and N3 may respectively be regardedas first to sixth transistors, and jointly form a multiplexer 36 alongwith the transistors P4 and N4. The transistors P5, P6, N5, N6 and theinverters 22 a, 24 a, 22 b, 24 b and 26 may form a master-slaveflip-flop circuit 38; nodes n1 a and n1 b may be regarded as twointernal input terminals of the flip-flop circuit 38.

In the multiplexer 36, gates of the transistors P1 and N1 may be coupledto the terminal SI, gates of the transistors Mp[.] (e.g., Mp[1] toMp[4]) may be commonly coupled to the terminal SEB, gates of thetransistors Mn[.] (e.g., Mn[1] to Mn[4]) may be commonly coupled to theterminal SE. Sources and drains of the transistors P1 and Mp[.] may beserially coupled between the voltage Vdd and the node n1 a to form acascode structure; similarly, sources and drains of the transistors N1and Mn[.] may be serially coupled between the voltage G and the node n1b. For example, assuming that the flip-flop 30 includes a number Kp oftransistors Mp[1] to Mp[Kp], then the source of the k-th transistorMp[k] may be coupled to the drain of the transistor Mp[k−1] (for k=2 toKp), the source of the transistor Mp[1] may be coupled to the drain ofthe transistor P1, the source of the transistor P1 may be coupled to thevoltage Vdd, and the drain of the transistor Mp[Kp] may be coupled tothe node n1 a. Similarly, assuming that the flip-flop 30 includes anumber Kn of transistors Mn[1] to Mn[Kn], then the source of the k-thtransistor Mn[k] may be coupled to the drain of the transistor Mn[k−1](for k=2 to Kn), the source of the transistor Mn[1] may be coupled tothe drain of the transistor N1, the source of the transistor N1 may becoupled to the voltage G, and the drain of the transistor Mn[Kn] may becoupled to the node n1 b. A gate, a source and a drain of the transistorP4 may respectively be coupled to the terminal D, the voltage Vdd and anode n0 a; a gate, a source and a drain of the transistor N4 mayrespectively be coupled to the terminal D, the voltage G and a node n0b. A source and a drain of the transistor P3 may be coupled between thenodes n0 a and n1 a, and a gate of the transistor P3 may be coupled tothe terminal SE; a source and a drain of the transistor N3 may becoupled between the nodes n0 b and n1 b, and a gate of transistor N3 maybe coupled to the terminal SEB.

When the flip-flop 30 works in a normal operation mode, a signal at theterminal SE may be kept equal to logic 0 (e.g., a low level as thevoltage G), and a signal at the terminal SEB may therefore equal logic 1(e.g., a high level as the voltage Vdd); accordingly, the transistors P3and N3 may be turned on to conduct, allowing signals at the nodes n1 aand n1 b to be controlled by a signal at the terminal D (e.g., a datasignal); equivalently, the normal operation data signal at the terminalD is allowed to be transmitted to the flop-flop circuit 38 via thetransistors P4 and N4; on the other hand, the transistors Mp[.] andMn[.] may be turned off to stop conducting, so a signal at the terminalSI (e.g., a scan input signal) may not be conducted to the nodes n1 aand n1 b. When the flip-flop 30 works in a scan test mode, the signal atthe terminal SE may be kept equal to logic 1, and then the signal at theterminal SEB may equal logic 0; in response, the transistors P3 and N3may be turned off to stop conducting, so the signal at the terminal Dmay not be conducted to the multiplexer 38; all the transistors Mp[.]and Mn[.] may be turned on to conduct, allowing the signals at the nodesn1 a and n1 b to be controlled by the signal at the terminal SI;equivalently, the scan input signal at the terminal SI is allowed to betransmitted to the flop-flop circuit 38 via the transistors P1 and N1.

In the flip-flop circuit 38, gates of the transistors P5 and N5 mayrespectively be coupled to the terminal CKI and CKB; a source and adrain of the transistor P5 may be coupled between the nodes n1 a and n1;and, a source and a drain of the transistor N5 may be coupled betweenthe nodes n1 b and n1. An input and an output of the inverter 22 a mayrespectively be coupled to the nodes n1 and n2; the inverter 22 b may beenabled and disabled by clocks at the terminals CKI and CKB, and, aninput and an output of the inverter 22 b may respectively be coupled tothe nodes n2 and n1. Gates of the transistors P6 and N6 may respectivelybe coupled to the terminals CKB and CKI; a source and a drain of thetransistor P6 may be coupled between the nodes n2 and n3; and, a sourceand a drain of the transistor N6 may be coupled between the nodes n2 andn3. An input and an output of the inverter 24 a may respectively becoupled to the nodes n3 and n4; the inverter 24 b may be enabled anddisabled by the clocks at the terminals CKI and CKB, and, an input andan output of the inverter 24 b may respectively be coupled to the nodesn4 and n3. An input and an output of the inverter 26 may respectively becoupled to the node n4 and the terminal Q.

When the clock at the terminal CKI is logic 0, the clock at the terminalCKB may be logic 1, so the transistors P5 and N5 may be turned on toconduct, allowing the signals at the nodes n1 a and n1 b to be conductedto the node n1, and transmitted to the node n2 via the inverter 22 a;the transistors P6 and N6 may be turned off to stop conducting, so thesignal at the terminal Q will not be affected by the node n2. When theclock at the terminal CKI transits to logic 1, the clock at the terminalCKB may accordingly transit to logic 0, so the transistors P5 and P6 maystop conducting, and the signal states of the nodes n1 a and n1 b, rightat the transition, may be latched between the inverters 22 a and 22 b;the transistors P6 and N6 may conduct, allowing the signal at the noden2 to be conducted to the node n3, and transmitted to the terminal Q viathe inverters 24 a and 26.

Because the multiplexer 36 is equipped with multiple stacked transistorsMn[.] and Mp[.] according to the invention, delay from the terminal SIto the flip-flop circuit 38 may be effectively increased, equivalently,delay along scan chain may be increased. Therefore, the flip-flop 30according to the invention may provide an effectively solution tohold-time violation of scan chain. The flip-flop 30 not only may improvescan chain timing violation for the scan test mode, but also maymaintain signal timing of the normal operation mode; because thetransistors Mn[.] and Mp[.] are serially coupled in cascode, so aresistance at each of the nodes n1 a and n1 b may be equivalent to adrain resistance of a single transistor. That is, during normaloperation, the resistance interfacing the signal D at the nodes n1 a andn1 b may be kept equal to a resistance of the multiplexer 32 in FIG. 1;therefore, normal operation timing of the flip-flop 30 in FIG. 2 may besubstantially identical to that of the flip-flop FF[.] in FIG. 1.Comparing to the scan flip-flops of various prior arts, the flip-flop 30according to the invention may provide longer scan chain delay bysmaller area overhead; in other words, by adopting the flip-flop 30,delay time provided by each unit area may be longer than those providedby the prior arts, hold-time violation may be solved more effectively,and usage of buffers may be further reduced, so as to decrease area andpower consumption of IC, increase integrity, and lower time, cost andresource of IC design.

Please refer to FIG. 3 illustrating a layout 40 according to anembodiment of the invention, which may be a layout of 28 nm fabricationprocess, and may be adopted to implement the flip-flop 30 in FIG. 2. Thelayout 40 may include multiple gate regions distributed along x-axisevenly by equal separation distances; these gate regions may be of anequal length L (dimension along x-axis), and formed by a same conductorlayer, e.g., a poly-silicon layer. In those gate regions, a gate regiongU may implement the gates of the transistors P1 and N1, each gateregion g[k] (e.g., for k=1 to 4) may implement the gates of thetransistor pair Mp[k] and Mn[k], and a gate region gD may form the gatesof the transistor pair P3 and N3. FIG. 3 also illustrates another layout42 of the same fabrication process, which may be adopted to implementthe flip-flop FF[.] in FIG. 1. Similar to the layout 40, the layout 42may also include multiple gate regions evenly distributed along x-axisby equal distance, such as the gate regions gpU, gp1 and gpD, etc. Thegate region gpU may implement the gates of the transistors Tp1 and Tn1(FIG. 1), the gate region gp1 may implement the gates of the transistorsTp2 and Tn2, and the gate region gpD may implement gates of thetransistors Tp3 and Tn3.

Comparing to the flip-flop FF[.] in FIG. 1, the flip-flop 30 in FIG. 2includes additional stacked transistors Mp[.] and Mn[.], so the lengthof the layout 40 is longer than that of the layout 42 by an interval Lv,as shown in FIG. 3. However, in advanced fabrication process, there isno need to arrange dummy gate region(s) between adjacent gate regionsgU, g[1] to g[4] and gD of the transistors P1, Mp[.] and P3, N1, Mn[.]and N3, therefore the flip-flop 30 may efficiently increase delay timeper unit area. In an embodiment, the additional interval Lv of thelayout 40 may be three pitches, but may therefore increase a delay timeof 70 ps, hence delay per unit area is much better (longer) than theprior arts.

The flip-flop 30 (e.g., the layout 40) of the invention, along with theflip-flop FF[.] (e.g., the layout 42) shown in FIG. 1, may both beincluded in a standard cell library to be different kinds of standardcells. Please refer to FIG. 4 illustrating a flowchart 100 according toan embodiment of the invention, which may adopt the flip-flop 30 of theinvention during IC design flow. Major steps of the flowchart 100 may beexplained as follows.

Step 102: place instances of standard cells in the layout of an IC. Ateach location where a scan flip-flop should be placed, place a flip-flopFF[.] shown in FIG. 1, and reserve an associated vacant region A[.]. Forexample, assuming a portion of the entire IC layout needs four scanflip-flops, so four flip-flops FF[k1], FF[k2], FF[k3] and FF[k4] areplaced during step 102, and an associated adjacent vacant region A[k1]is reserved aside the flip-flop FF[k1], an associated adjacent vacantregion A[k2] is reserved aside the flip-flop FF[k2], an associatedadjacent vacant region A[k3] is reserved aside the flip-flop FF[k3], andan associated adjacent vacant region A[k4] is reserved aside theflip-flop FF[k4]. The length of each region A[.] may be longer than, orequal to, the interval Lv (in FIG. 3).

Steps 104, 106 and 108: respectively perform pre-CTS, CTS (clock treesynthesis) and post-CTS on the placed instances of standard cells.

Step 110: perform a timing test on the result of CTS, and accordinglyselecting to-be-replaced flip-flops from the placed scan flip-flops. Thetiming test may include hold-time test, so as to find which flip-flopsFF[.] violates hold-time requirement, and the flip-flops sufferinghold-time violation are regarded as the to-be-replaced flip-flops. Afterthe to-be-replaced flip-flops are found, perform a replacement step byreplacing each to-be-replaced flip-flop FF[.] with a scan flip-flopeFF[.] of the invention, i.e., an instance of the flip-flop 30 shown inFIG. 2. Because the heights (dimension alone y-axis) of the flip-flopsFF[.] and eFF[.] may be identical, and the length (alone x-axis) of theregion A[.] may cover the interval Lv, so the layout of the flip-flopeFF[.] may be completely covered by a total (union) region of theflip-flop FF[.] and the vacant region A[.]. In the example of FIG. 4,assuming that the flip-flops FF[k1] and FF[k3] are to-be-replacedflip-flops, then, during step 110, a flip-flops eFF[k1] may be insertedto a region originally occupied by the flip-flop FF[k1] and A[k1], andan original layout of the flip-flop FF[k3] and the vacant region A[k3]may be replaced by a layout of the flip-flop eFF[k3]. Other vacantregions A[.] which do not need to be replaced, such as the vacantregions A[k2] and A[k4], may be utilized to place other element(s) orcell(s), e.g., buffer(s) and decoupling capacitor(s).

Step 112: continue the design flow by performing routing on theresultant IC layout of step 110.

The steps of the flowchart 100 may be performed automatically bycomputer. Because the flip-flop according to the invention mayeffectively increase hold-time margin, then may also expand flexibilityof reordering scan chain, and the flowchart 100 may further include astep to perform scan reordering, e.g., between steps 102 and 104.

To sum up, comparing to prior arts, the scan flip-flop according to theinvention may efficiently expand delay time per unit area, effectivelyimprove hold-time violation, substantially reduced required buffers,power consumptions, routing length and layout area of IC, and enhanceefficiency of IC design, so the design flow may satisfy timing demandsof both the normal operation and scan chain, quickly converge tosolution(s) without compromising any timing demands, and reduce time,cost and resource of the design flow.

While the invention has been described in terms of what is presentlyconsidered to be the most practical and preferred embodiments, it is tobe understood that the invention needs not be limited to the disclosedembodiment. On the contrary, it is intended to cover variousmodifications and similar arrangements included within the spirit andscope of the appended claims which are to be accorded with the broadestinterpretation so as to encompass all such modifications and similarstructures.

What is claimed is:
 1. A method for a circuit layout, comprising:placing a plurality of first kind scan flip-flops in the circuit layout,and reserving an associated adjacent vacant region aside each of theplurality of first kind scan flip-flops; performing a timing test on theplurality of first kind scan flip-flops, and accordingly selecting afirst number of to-be-replaced flip-flops from the plurality of firstkind scan flip-flops; and performing a replacement step by replacingeach of the first number of to-be-replaced flip-flops with a second kindscan flip-flop; wherein the second kind scan flip-flop comprises: a datainput terminal; a scan input terminal; an internal circuit comprising afirst internal input terminal, capable of latching an internal signalreceived via the first internal input terminal in response to a clock; afirst transistor comprising a first gate, a first source and a firstdrain; a plurality of second transistors, each of the plurality ofsecond transistors comprising a second gate, a second source and asecond drain; and a third transistor comprising a third gate, a thirdsource and a third drain, the third source and the third drain beingcoupled between the first internal input terminal and the data inputterminal, and the third gate being coupled to a second enabling signal;wherein the second sources and the second drains of the plurality ofsecond transistors, and the first source and the first drain, areserially coupled between a first voltage and the first internal inputterminal, the first gate is coupled to the scan input terminal, and thesecond gates of the plurality of second transistors are commonly coupledto a first enabling signal; and wherein the second enabling signal andthe first enabling signal are of opposite phases.
 2. The method of claim1, wherein the timing test comprises a hold-time test.
 3. The method ofclaim 1 further comprising: before performing the timing test,performing a clock tree synthesis to provide a clock for each of theplurality of first kind scan flip-flops.
 4. The method of claim 1further comprising: performing a scan reordering.
 5. The method of claim1, wherein the internal circuit further comprises a second internalinput terminal, and the second kind scan flip-flop further comprises: afourth transistor comprising a fourth gate, a fourth source and a fourthdrain; and a plurality of fifth transistors, each of the plurality offifth transistors comprising a fifth gate, a fifth source and a fifthdrain; wherein the fifth sources and the fifth drains of the pluralityof fifth transistors, and the fourth source and the fourth drain, areserially coupled between a second voltage and the second internal inputterminal, the fourth gate is coupled to the scan input terminal, and thefifth gates of the plurality of fifth transistors are commonly coupledto the second enabling signal.
 6. The method of claim 5, wherein thesecond kind scan flip-flop further comprises: a sixth transistorcomprising a sixth gate, a sixth source and a six drain, the sixthsource and the sixth drain being coupled between the second internalinput terminal and the data input terminal, and the sixth gate beingcoupled to the first enabling signal.